package com.example.zyh.mapper;


import com.example.zyh.pojo.Yezhu;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface YezhuMapper {
    @Select("select * from yezhu")
    public List<Yezhu> select();
    @Insert("INSERT INTO yezhu (`name`, `sex`, `age`, `address`, `idcard`)\n" +
            "\tVALUES(#{name},#{sex},#{age},#{address},#{idcard})")
    public void addYezhu(Yezhu yezhu);
    @Delete("DELETE FROM yezhu  WHERE `id` = #{id}")
    public void deleteYezhu(int id);
    @Update("UPDATE yezhu SET `name` =#{name}, `sex` =#{sex}, `age` = #{age}, `address` = #{address}, `idcard` = #{idcard} WHERE `id`=#{id}")
    public void updateYezhu(Yezhu yezhu);
    @Select("SELECT * FROM yezhu where name=#{name} or age=#{age} or address=#{address}")
    public List<Yezhu> selectlike(Yezhu yezhu);

}
